home *** CD-ROM | disk | FTP | other *** search
- /***
- *** Copyright (c) 1990 Rijksinstituut voor Visserijonderzoek.
- *** All rights reserved.
- ***
- *** Redistribution and use in source and binary forms are permitted
- *** provided that this notice is preserved and that due credit is given
- *** to the Rijksinstituut voor Visserijonderzoek at IJmuiden.
- *** This software is provided "as is" without express or implied warranty.
- ***
- *** @(#)MacSocket.h 1.2 91/01/25
- ***/
-
- #ifndef _MacSocket_H_
- #define _MacSocket_H_
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unix.h>
- #include <DeviceMgr.h>
-
- #include "types.h"
- #include "socket.h"
- #include "in.h"
- #include "netdb.h"
- #include "TCPPB.h"
-
- #ifdef LAB_VIEW
-
- /* to prevent the use of the malloc() call in a LabVIEW CIN */
- #define SockElmnt theSockElmnt
- #define SizeOf(x) x
- #define malloc(x) &x
-
- #else
-
- #define SizeOf sizeof
-
- #endif LAB_VIEW
-
- #ifndef NIL
- #define NIL ((void*) 0L)
- #endif NIL
- #ifndef InFrontOfAll
- #define InFrontOfAll ((Ptr) -1L)
- #endif InFrontOfAll
- #ifndef True
- #define True (1)
- #endif True
- #ifndef False
- #define False (0)
- #endif False
- #define Abort True
- #define ReportIt False
- #define Asynchronous True
- #define Synchronous False
- #define ConnectTimeout (15)
- #define SendTimeout (15)
- #define RecvTimeout (15)
- #define CloseTimeout (15)
- #define SockBufSize (16384)
- #define UserDataSize (128)
-
- #define noTCPDriver (-1)
- #define invalidArgument (2)
- #define nonSOCK_STREAM (13)
- #define nonSocket (38)
- #define nonAF_INET (43)
- #define noBufSpace (55)
- #define commandInProgress (1)
-
- /* to force the application first to use the MacSocket versions */
- #define perror perror_MacSocket
- #define exit exit_MacSocket
- #define close close_MacSocket
- #define strerror strerror_MacSocket
-
- /* Prototypes */
- int accept(int s, struct sockaddr *addr, int addrlen);
- int bind(int s, struct sockaddr *name, int namelen);
- int close_MacSocket(int s);
- int connect(int s, struct sockaddr_in *name, int namelen);
- void exit_MacSocket(int status);
- int listen(int s, int backlog);
- void perror_MacSocket(char *s);
- int recv(int s, char *msg, int len, int flags);
- int recvfrom(int s, char *msg, int len, int flags, struct sockaddr_in *from,
- int *fromlen);
- int recvmsg(int s, struct msghdr *msg, int flags);
- int send(int s, char *msg, int len, int flags);
- int sendto(int s, char *msg, int len, int flags, struct sockaddr_in *to, int tolen);
- int sendmsg(int s, struct msghdr *msg, int flags);
- int shutdown(int s, int how);
- #ifdef MAC_APPL
- void SetDialogShowTime(int sec);
- #endif MAC_APPL
- int socket(int domain, int type, int protocol);
- char* strerror_MacSocket(int errnum);
-
- #endif _MacSocket_H_
-